# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: speps <speps at aur dot archlinux dot org>

pkgname=zita-alsa-pcmi
pkgver=0.6.1
pkgrel=1
pkgdesc="The successor of clalsadrv, provides easy access to ALSA PCM devices."
arch=(x86_64)
url="https://kokkinizita.linuxaudio.org/linuxaudio/"
license=(GPL3)
depends=(gcc-libs glibc)
makedepends=(alsa-lib)
provides=(libzita-alsa-pcmi.so)
options=(debug)
source=(
  https://kokkinizita.linuxaudio.org/linuxaudio/downloads/$pkgname-$pkgver.tar.bz2
  $pkgname-0.5.1-apps_makefile.patch
  $pkgname-0.5.1-source_makefile.patch
)
sha512sums=('f4f8f4f834f566a2b81fc9f23c49714815b68e4c6c0b840830592a2d80171e6d4538aacfeb2d3f835bd28fec1a5e1f232c97c4dce254f797ce262e5414062cbc'
            '283430c8b3aa8e8e436b4ed875282b5f5247410e6b391e2ca4106624db41bff44f186e2a274be8a915bef5efb46d8a104fddc4cdf4abfccdfe63cec170c1f3e0'
            '7992478d1c786f8b84bdb17ad2c11af5e3bfa5bbf802c28c1c2524967d670509e0db2fac7dd174c9dcb3a3463d02fbcfaecaa8144d72336042b02cecf156542f')
b2sums=('15c089131cd859f4686e06383abab5296bacfc88f10fcd323eca99b46455d3387a3505ae6e6ed2bc8cafab0f3612966ad45e796b1eb0ffa211f06876ed1909b7'
        '8a370033fa8f50b4fd494091f70acd6f75df12230a6035e12efa263cb369071b06b7e6024141cad511371db8a5d47daf57cbdd3ba427db78d4d12df5ec41cf87'
        'eee76b79eb7e7d388b12031829bbd45c28afbc51aa63d23de919b42f32b63976bc5f07f916ffdad62264c657ff1571ade485b8050fcbadc2db7a71fc8ea3ccea')

prepare() {
  patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.5.1-apps_makefile.patch
  patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.5.1-source_makefile.patch
}

build() {
  make -C $pkgname-$pkgver/source
  make -C $pkgname-$pkgver/apps
}

package() {
  depends+=(libasound.so)

  make -C $pkgname-$pkgver/source DESTDIR="$pkgdir/" PREFIX=/usr SUFFIX="" install
  make -C $pkgname-$pkgver/apps DESTDIR="$pkgdir/" PREFIX=/usr install
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
# vim:set ts=2 sw=2 et:
